#include "WPILib.h"
#include "Robot2489.h"

//.6 is the expand time for the cylinder with the magnet on it

extern bool kicking;

	/**
	 * Constructor for this robot subclass.
	 * 
	 * Creates an instance of a RobotDrive with left and right motors plugged
	 * into PWM ports 1 and 2 on the first digital module. Why is 
	 * SpeedController &rearLeftMotor 3 and SpeedController &rearRightMotor 4?
	 */
	Robot2489::Robot2489(void)
	{
		leftMotorController = new Jaguar(9);
		rightMotorController = new Jaguar(10);
		myRobot = new RobotDrive(leftMotorController, rightMotorController); // create robot drive base
		ds = DriverStation::GetInstance();
		//RobotDrive(1,2,3,4);
		rightStick = new Joystick(2); // create the joysticks
		leftStick = new Joystick(1);
		manipStick = new Joystick(3);
		KarlKompressor = new Compressor(4, 1, 4, 1);
		solKickOut = new Solenoid(8,1);
		solKickIn = new Solenoid(8,2);
		solLatch = new Solenoid(8,3);
		solTower = new Solenoid(8,4);
		//kickTask = new Task("kickTaskName",(FUNCPTR)s_kickFunction);
		kickTimar = new Timer();
		screen = DriverStationLCD::GetInstance();
		dseio = &DriverStation::GetInstance()->GetEnhancedIO();
		GetWatchdog().SetExpiration(0.1);
	}
	
	
	/*
	 * Destructor which probably isn't necessary but we'll include anyway to
	 * appear professional. HEH :D
	 */
	Robot2489::~Robot2489(void)
	{ 
		delete KarlKompressor;
		delete myRobot;
		delete ds;
		delete rightStick;
		delete leftStick;
		delete solKickOut;
		delete solKickIn;
		delete solLatch;
		delete solTower;
		delete kickTimar;
		//delete kickTask;
		delete screen;
	}
	
START_ROBOT_CLASS(Robot2489);
